<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>试卷</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/qcby/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/qcby/layuiadmin/style/admin.css" media="all">
    <link rel="stylesheet" href="/qcby/layuiadmin/style/template.css" media="all">
    <link href="/qcby/favicon.ico" rel="shortcut icon" />
</head>
<body>
    <div class="layui-fluid">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                <div class="layui-card layadmin-serach-main">
                    <div class="layui-card-header" style="width: 300px;margin: 0 auto;">
                        <p style="font-size: 18px;">
                            <strong id="title" th:text="${testTitle}"></strong>
                        </p>
                        <p style="font-size: 15px;">
                            <strong id="className" th:text="${cla_name}"></strong>
                        </p>
                        <p style="font-size: 15px;display: none;">
                            <strong id="testid" th:text="${testId}"></strong>
                        </p>
                    </div>

                    <div class="layui-card-body" >
                        <strong th:if="${not #lists.isEmpty(one)}">一、单项选择题</strong>
                        <ol style="margin-left: 40px;">
                            <li th:each="one:${one}" class="layui-form" style="list-style: decimal;">
                                <label class="layui-form-label" th:text="'(' + ${one.fraction} +')' +${one.topic}"></label>
                                <label class="layui-form-label" style="display: none" th:text="${one.id}"></label><br>
                                <div class="layui-form-item">
                                <div class="layui-input-block" lay-filter>
                                   <input type="radio" name="XZ" value="A" th:title="'A:' + ${one.a}"><br>
                                   <input type="radio" name="XZ" value="B" th:title="'B:' +  ${one.b}"><br>
                                   <input type="radio" name="XZ" value="C" th:title="'C:' +  ${one.c}"><br>
                                   <input type="radio" name="XZ" value="D" th:title="'D:' +  ${one.d}">
                                </div>
                              </div>
                            </li>
                            <hr />

                        </ol>
                        <strong th:if="${not #lists.isEmpty(two)}">二、多项选择题</strong>
                        <ol style="margin-left: 40px;">
                            <li th:each="two:${two}" class="layui-form" style="list-style: decimal;">
                                <div class="layui-form-item">
                                    <label class="layui-form-label" th:text="'(' + ${two.fraction eq null ? 0 : two.fraction} +')' +${two.topic}"></label>
                                    <label class="layui-form-label"  style="display: none"  th:text="${two.id}"></label><br>
                                    <div class="layui-input-block" lay-filter="*">
                                        <input type="checkbox" name="like[write]" th:title="'A:' + ${two.a}"><br>
                                        <input type="checkbox" name="like[read]" th:title="'B:' + ${two.b}"><br>
                                        <input type="checkbox" name="like[daze]" th:title="'C:' + ${two.c}"><br>
                                        <input type="checkbox" name="like[daze]" th:title="'D:' + ${two.d}">
                                    </div>
                                </div>
                            </li><hr>
                        </ol>
                        <strong th:if="${not #lists.isEmpty(three)}">三、简答题</strong>
                        <ol class="layadmin-serach-list" style="margin-left: 40px;" id="jianda">
                            <li th:each="three:${three}" style="list-style: decimal;">
                                <label class="layui-form-label" th:text="'(' + ${three.fraction eq null ? 0 : three.fraction} +')' +${three.topic}"></label>
                                <label class="layui-form-label" style="display: none"  th:text="${three.id}"></label><br><br>
                                <textarea  th:id="${three.id}" style="display: none" ></textarea>
                            </li><hr>
                        </ol>

                        <form action="/qcby/teacher/release" method="post">
                            <div class="layui-inline">
                                <label class="layui-form-label">考试时间</label>
                                <div class="layui-input-inline">
                                    <input type="text" class="layui-input" name="date" id="test10" required placeholder="请选择时间范围">
                                </div>
                            </div>
                            <div >
                                <input type="text" th:value="${testTitle}"  name="title" id="testitle" style="display: none" />
                                <input type="text" th:value="${testId}"  name="testid" id="tesid" style="display: none" />
                                <input type="text" th:value="${cla_name}" name="className" id="cla_name" style="display: none" />
                            </div>
                            <button style="margin-top: 25px;margin-left: 208px;" class="layui-btn layuiadmin-btn-admin" type="submit">发布</button>
                        </form>
<!--                        <button style="margin-left: 85px;position: relative;top: -38px" class="layui-btn layuiadmin-btn-admin" data-type="batchdel"><a lay-href="/qcby/views/home/timu.html">返回</a></button>-->
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script src="/qcby/layuiadmin/layui/layui.js"></script>
    <script>
        layui.config({
            base: '/qcby/layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index', 'laypage','layedit','form','laydate','jquery','cookie'], function(){
            var laypage = layui.laypage;
            var layedit = layui.layedit;
            var laydate = layui.laydate;
            var $ = layui.jquery;

            let cookie = layui.cookie;
            let session = $.cookie('the_cookie');
            if(session == null || session == ""){
                layer.alert("您还未登录，请先登录",{icon:5},function () {
                    location.href="/qcby/views/user/login.html";
                });
            }


            var objul=document.getElementById("jianda");
            var lis=objul.getElementsByTagName("textarea");
            for(var i = 0 ; i < lis.length ; i++){
                layedit.build(lis[i].id);
            }

            laypage.render({
                elem: 'LAY-template-search-page'
                ,count: 70
                ,jump: function(obj, first){
                    if(!first){
                        layer.msg('第'+ obj.curr +'页');
                    }
                }
            });

            //日期时间范围
            laydate.render({
                elem: '#test10'
                ,type: 'datetime'
                ,range: true
            });

        });
    </script>
</body>
</html>